<!DOCTYPE html "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">


<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="Form">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">编号：</label>
                            <div class="col-sm-10">
                                <input id="id"  name="id" th:value="${paramConfig.id}"
                                       class="form-control" type="text"  readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">标题：</label>
                            <div class="col-sm-10">
                                <input id="paramName"  name="paramName" th:value="${paramConfig.paramName}"
                                       class="form-control" type="text"  readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">key：</label>
                            <div class="col-sm-10">
                                <input id="paramKey"  name="paramKey" th:value="${paramConfig.paramKey}"
                                       class="form-control" type="text"  readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">姓名.电话.地址：</label>
                            <div class="col-sm-10">
                                <input id="paramValue"  name="paramValue" th:value="${paramConfig.paramValue}"
                                       class="form-control" type="text" >
                            </div>
                        </div>

                        <div class="text-right form-group">
                            <button type="submit" class="btn btn-primary">提交</button>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script th:inline="javascript">
    $().ready(function () {
        validateRule();

    });
    $.validator.setDefaults({
        submitHandler: function () {
            save();
        }
    });



    function save() {
        $.ajax({
            cache: true,
            type: "POST",
            url: "/app/orderReturn/updatePar",
            data: $('#Form').serialize(), // 你的formid
            async: false,
            success: function (data) {
                layer.msg("操作成功");
                parent.reLoad();
                var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                parent.layer.close(index);
            }
        });
    }
    function validateRule() {
        var icon = "<i class='fa fa-times-circle'></i> ";
        $("#Form").validate({
            rules: {
                paramValue:{
                    required: true
                }
            },
            messages: {
                paramValue:{
                    required: icon + "必填"
                }
            }
        })
    }

</script>
</body>
</html>